@extends('layouts.header')
@section('content')
    <article class="page-container">
        <form class="form form-horizontal" id="form" autocomplete="off">
            <div class="row cl">
                <label class="form-label col-sm-3">问题标题：</label>
                <label class="form-label col-sm-9" style="text-align: left;"> 
                    <input class="input-text" type="text" name="title" value="{{ data_get($info_help,'title','') }}" />
                </label>
            </div>
            <div class="row cl">
                <label class="form-label col-sm-3">上传pdf答案：</label>
                <div class="formControls col-sm-9">
                    <span class="btn-upload form-group">
                        <input class="input-text upload-url radius" type="text" readonly placeholder="不能大于10M，后缀必须为.pdf"><a href="javascript:void();" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
                        <input type="file" name="pdf" class="input-file" single accept="application/pdf">
                    </span>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-sm-3">上传视频答案：</label>
                <div class="formControls col-sm-9">
                    <span class="btn-upload form-group">
                        <input class="input-text upload-url radius" type="text" readonly placeholder="不能大于50M，后缀必须为.mp4"><a href="javascript:void();" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
                        <input type="file" name="video" class="input-file" single accept="video/wmv, video/avi, video/mp4, video/flv, video/3gp, video/mov, video/mkv, video/vob" data-maxLength="50M">
                    </span>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-sm-3">问题答案简述：</label>
                <div class="formControls col-sm-6">
                    <textarea name="content" class="textarea" value="{{ data_get($info_help,'content','') }}"></textarea>
                </div>
            </div>
            <div class="row cl pt-20">
                <div class="col-sm-9 col-sm-offset-3">
                    <span class="btn btn-primary radius" id="submit">&nbsp;&nbsp;提交&nbsp;&nbsp;</span>
                    <input class="btn btn-danger radius ml-15" type="button" value="&nbsp;&nbsp;取消&nbsp;&nbsp;" onclick="layer_close();">
                </div>
            </div>
        </form>
    </article>
    <script type="text/javascript">
        $('#submit').on('click',function () {
            var formData = new FormData($("#form")[0]);  
            console.log(formData);
            ajax('post','edit',formData,editBak,1,1,false);
            function editBak(res) {
                console.log(res);
            }
        })
    </script>
@endsection